﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace BodaNetCommunications.Utilities.Extensions
{
    public static class StringExt
    {
        // 控制字符
        private static readonly Regex ControlCharRegex = new Regex(@"[\p{C}]", RegexOptions.Compiled);

        /// <summary>
        /// 移除控制字符
        /// </summary>
        public static string RemoveControlChars(this string text)
        {
            return ControlCharRegex.Replace(text, string.Empty);
        }
    }
}
